import sys
from PyQt4 import QtGui, QtCore
from PyQt4.QtGui import *
from PyQt4.QtCore import Qt 

class SlaveMarketTitle(QWidget):
	def __init__(self, *args, **kw):
		QWidget.__init__(self, *args, **kw)
#
#		set the background graphic
#
		pic = QLabel(self)
		path = "resources/slave_market_title.png"
		pic.setPixmap(QPixmap(path))
		pic.setGeometry(0, 0, 435, 73)
#
#		now place a label to hold the caption
#
		text = QLabel(self)
		text.setGeometry(15, 22, 400, 50)
#
#		set the text and font
#
		text.setText("The Souk Auction Block")
		font = QtGui.QFont("Gabrielle", 24)
		text.setFont(font)
#
#		and center it
#
		text.setAlignment(Qt.AlignHCenter|Qt.AlignHCenter)



class SlaveFrame(QWidget):
	def __init__(self, *args, **kw):
		QWidget.__init__(self, *args, **kw)

		bg = QtGui.QLabel(self)
		#path = "resources/slave_frame_bg"
		path = "resources/slave_market_screen_bg.png"
		bg.setGeometry(20, 23, 416, 585)
		bg.setPixmap(QtGui.QPixmap(path))

		self.pic = QtGui.QLabel(self)
		#path = "resources/characters/Bunny Girl/Profile1.jpg"
		self.pic.setGeometry(20, 23, 416, 585)

		frame = QtGui.QLabel(self)
		frame.setGeometry(0, 0, 454, 622)
		path = "resources/slave_frame.png"
		frame.setPixmap(QtGui.QPixmap(path))

	def set_image(self, path):
		pm = QtGui.QPixmap(path)
		pm = pm.scaled(416, 585, Qt.KeepAspectRatio)
		self.pic.setPixmap(pm)


if __name__ == "__main__":
	path = "resources/characters/Bunny Girl/Profile1.jpg"

	app = QtGui.QApplication(sys.argv)

	font_db = QFontDatabase()
	font_db.addApplicationFont("resources/Gabrielle.ttf")
	font_db.addApplicationFont("resources/mark.ttf")

	top = QtGui.QLabel()
	path = "resources/wood.jpg"
	top.setGeometry(0, 0, 1024, 768)
	top.setPixmap(QtGui.QPixmap(path))

	panel = SlaveMarketTraitPanel(top)
	panel.move(750, 500)

	title = SlaveMarketTitle(top)
	title.move((1024-897)/2, 20)

	frame = SlaveFrame(top)
	frame.move((1024-897)/2, 100)

	top.show()
	sys.exit(app.exec_())
